package cn.sunchis.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.gftech.framework.api.UnifyResponse;

/**
 * Nacos消费者
 * @Author 许亮
 * @Create 2019-12-25 11:10:08
 */
@RefreshScope
@RestController
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class NacosConsumerApplication {
	@Autowired
	private NacosProviderRemoteClient nacosProviderRemoteClient;
	
	public static void main(String[] args) {
		SpringApplication.run(NacosConsumerApplication.class, args);
	}
	
	@GetMapping("/consumeNow")
	public UnifyResponse<?> consumeNow() {
		return nacosProviderRemoteClient.now();
	}
}
